export const BASEURL = 'https://bdqnapi.henrysea.cn/jeecg-boot/cms/client'

export const request = ({url,method="GET",data={}})=>{
	return new Promise((resolve,reject)=>{
		wx.request({
			url: BASEURL + url,
			method,
			data,
			success:({data})=>{
				if(data.code===200){
					resolve(data.data)
				}else{
					uni.showToast({
						title:data.message,
						icon:'none'
					})
					reject()
				}
			},
			fail:(err)=>{
				uni.showToast({
					title:'网络错误',
					icon:'none'
				})
			}
		})
	})
}